package com.example.modulepicselector.internal.entity;

import com.example.modulepicselector.engine.ImageEngine;
import com.example.modulepicselector.engine.impl.ImageTanEngine;

public class SelectionSpec {
    public boolean countable;
    public int maxSelectable;
    public int maxImageSelectable;
    public ImageEngine imageEngine;

    private volatile static SelectionSpec instance;


    private SelectionSpec() {
    }

    public static SelectionSpec getInstance() {
//        return InstanceHolder.INSTANCE;

        if (instance == null) {
            synchronized (SelectionSpec.class) {
                if (instance == null) {
                    instance = new SelectionSpec();
                }
            }
        }return instance;
    }

    public static SelectionSpec getCleanInstance() {
        SelectionSpec selectionSpec = getInstance();
        selectionSpec.reset();
        return selectionSpec;
    }

    private void reset() {
        countable = false;
        maxSelectable = 1;
        maxImageSelectable = 1;
        imageEngine = new ImageTanEngine();
    }




}

